1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.purple.imgstore; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 34 extern (C): 35 36 alias _PurpleStoredImage PurpleStoredImage; 37 38 struct _PurpleStoredImage; 39 40 version(Derelict_Link_Static) 41 { 42 extern( C ) nothrow 43 { 44 PurpleStoredImage* purple_imgstore_add(gpointer data, size_t size, const(char)* filename); 45 PurpleStoredImage* purple_imgstore_new_from_file(const(char)* path); 46 int purple_imgstore_add_with_id(gpointer data, size_t size, const(char)* filename); 47 PurpleStoredImage* purple_imgstore_find_by_id(int id); 48 gconstpointer purple_imgstore_get_data(PurpleStoredImage* img); 49 size_t purple_imgstore_get_size(PurpleStoredImage* img); 50 const(char)* purple_imgstore_get_filename(const(PurpleStoredImage)* img); 51 const(char)* purple_imgstore_get_extension(PurpleStoredImage* img); 52 PurpleStoredImage* purple_imgstore_ref(PurpleStoredImage* img); 53 PurpleStoredImage* purple_imgstore_unref(PurpleStoredImage* img); 54 void purple_imgstore_ref_by_id(int id); 55 void purple_imgstore_unref_by_id(int id); 56 void* purple_imgstore_get_handle(); 57 void purple_imgstore_init(); 58 void purple_imgstore_uninit(); 59 } 60 } 61 else 62 { 63 extern( C ) nothrow 64 { 65 alias da_purple_imgstore_add = PurpleStoredImage* function(gpointer data, size_t size, const(char)* filename); 66 alias da_purple_imgstore_new_from_file = PurpleStoredImage* function(const(char)* path); 67 alias da_purple_imgstore_add_with_id = int function(gpointer data, size_t size, const(char)* filename); 68 alias da_purple_imgstore_find_by_id = PurpleStoredImage* function(int id); 69 alias da_purple_imgstore_get_data = gconstpointer function(PurpleStoredImage* img); 70 alias da_purple_imgstore_get_size = size_t function(PurpleStoredImage* img); 71 alias da_purple_imgstore_get_filename = const(char)* function(const(PurpleStoredImage)* img); 72 alias da_purple_imgstore_get_extension = const(char)* function(PurpleStoredImage* img); 73 alias da_purple_imgstore_ref = PurpleStoredImage* function(PurpleStoredImage* img); 74 alias da_purple_imgstore_unref = PurpleStoredImage* function(PurpleStoredImage* img); 75 alias da_purple_imgstore_ref_by_id = void function(int id); 76 alias da_purple_imgstore_unref_by_id = void function(int id); 77 alias da_purple_imgstore_get_handle = void* function(); 78 alias da_purple_imgstore_init = void function(); 79 alias da_purple_imgstore_uninit = void function(); 80 } 81 82 __gshared 83 { 84 da_purple_imgstore_add purple_imgstore_add; 85 da_purple_imgstore_new_from_file purple_imgstore_new_from_file; 86 da_purple_imgstore_add_with_id purple_imgstore_add_with_id; 87 da_purple_imgstore_find_by_id purple_imgstore_find_by_id; 88 da_purple_imgstore_get_data purple_imgstore_get_data; 89 da_purple_imgstore_get_size purple_imgstore_get_size; 90 da_purple_imgstore_get_filename purple_imgstore_get_filename; 91 da_purple_imgstore_get_extension purple_imgstore_get_extension; 92 da_purple_imgstore_ref purple_imgstore_ref; 93 da_purple_imgstore_unref purple_imgstore_unref; 94 da_purple_imgstore_ref_by_id purple_imgstore_ref_by_id; 95 da_purple_imgstore_unref_by_id purple_imgstore_unref_by_id; 96 da_purple_imgstore_get_handle purple_imgstore_get_handle; 97 da_purple_imgstore_init purple_imgstore_init; 98 da_purple_imgstore_uninit purple_imgstore_uninit; 99 } 100 }